﻿using System.Xml.Serialization;

namespace Metozis.SimpleXMLSerialization.Products
{
    public class Product
    {
        /* Setting the IsNullable property to false instructs the 
        XmlSerializer that the XML attribute will not appear if 
        the Name field is set to a null reference. 
        If IsNullable property is set to true then XmlSerializer generates 
        xsi:nil attribute for the specific field that is null*/

        [XmlElement(IsNullable = false)]
        public string Name { get; set; }

        public string SerialNumber { get; set; }

        public Category Category { get; set; }
    }
}